Stage uploads on the cache filesystem - #13814
Draft
abidlabs wants to merge 2 commits into
Draft
Conversation
Collaborator
🦄 change detectedThis Pull Request includes changes to the following packages.
|
Collaborator
🪼 branch checks and previews
Install Gradio from this PR pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/a3716939b6cdcab788a7a295bfa2abaaa87e2196/gradio-6.26.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@a3716939b6cdcab788a7a295bfa2abaaa87e2196#subdirectory=client/python"Import Gradio JS Client from this PR via CDN import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/a3716939b6cdcab788a7a295bfa2abaaa87e2196/browser.js"; |
Member
Author
Before / after Spaces
Both Spaces run the same app with multipart staging on
|
abidlabs
requested review from
dawoodkhan82 and
hysts
and
a balanced review from Copilot
September 2, 2026 22:28
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The hand-authored changeset must be removed per repository policy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Stages multipart uploads on Gradio’s cache filesystem to ensure atomic publication.
Changes:
- Configures multipart temporary-file placement.
- Adds a regression test for cross-filesystem uploads.
- Adds a manual changeset.
File summaries
| File | Description |
|---|---|
gradio/route_utils.py |
Stages uploads in the configured upload directory. |
test/test_routes.py |
Tests synchronous upload publication. |
.changeset/seven-bears-stick.md |
Adds a prohibited manual changeset. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1
to
+5
| --- | ||
| "gradio": patch | ||
| --- | ||
|
|
||
| fix:Stage uploads on the cache filesystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Multipart uploads were staged in the operating-system temp directory. When
GRADIO_TEMP_DIRwas on another filesystem, the final rename failed and/uploadreturned the destination before a background copy published it.Stage upload temp files in Gradio's configured upload directory so the final content-addressed rename stays on one filesystem and completes before the response. This avoids both the publication race and an extra synchronous copy of large uploads.
Closes: #13722
AI Disclosure
🎯 PRs Should Target Issues
This PR targets #13722. I checked for overlapping open PRs; none were found.
Testing and Formatting Your Code
python3 -m pytest test/test_routes.py::TestRoutes::test_upload_is_staged_in_custom_upload_path -qruff check --no-cache gradio/route_utils.py test/test_routes.pyruff format --check gradio/route_utils.py test/test_routes.pyty check --python /Library/Frameworks/Python.framework/Versions/3.14/bin/python3 gradio/route_utils.pyMinimal reproduction:
The reproduction files were not committed.